<template>
  <div>
    <el-table
      :data="tableData"
      style="width: 100%"
      border
      @row-click="rowClick"
    >
      <el-table-column prop="projectCode" label="项目编号"></el-table-column>
      <el-table-column prop="projectName" label="项目名称"> </el-table-column>
      <el-table-column prop="memberStr" label="成员"> </el-table-column>
      <el-table-column prop="dtotals" label="总日报数"> </el-table-column>
      <el-table-column prop="mtotals" label="我的日报数"> </el-table-column>
    </el-table>
    <dialog-view :show="show" @close="close" :projectCode="projectCode" />
  </div>
</template>

<script>
import dialogView from "./dialogView.vue";
export default {
  components: {
    dialogView,
  },
  props: ["datas"],
  data() {
    return {
      tableData: [],
      show: false,
      projectCode: "", //项目编号
    };
  },
  watch: {
    datas(newV) {
      console.log(newV, "newV");
      this.tableData = newV;
    },
  },
  methods: {
    rowClick(row, column, event) {
      console.log(row, column, event);
      this.show = true;
      this.projectCode = row.projectCode;
    },
    close(e) {
      if (e == true) {
        this.show = false;
        this.projectCode = "";
      }
    },
  },
};
</script>

<style>
</style>